<template>
  <div class="bg-[#232324] h-[100%]">
    <el-collapse v-loading="loading" v-model="activeNames">
      <el-form label-width="100" :model="states" size="default">
        <el-collapse-item title="按钮属性" name="1">
          <el-form-item label="输入框大小">
            <el-select v-model="states.size" placeholder="按钮类型">
              <el-option label="小" value="small" />
              <el-option label="大" value="large" />
              <el-option label="默认" value="default" />
            </el-select>
          </el-form-item>
          <el-form-item label="内容">
            <el-input v-model="states.value" />
          </el-form-item>
          <el-form-item label="输入占位文字">
            <el-input v-model="states.placeholder" />
          </el-form-item>
          <el-form-item label="是否可清空">
            <el-switch v-model="states.clearable" />
          </el-form-item>
          <el-form-item label="显示统计字数">
            <el-switch v-model="states.showWordLimit" />
          </el-form-item>
          <el-form-item label="是否禁用">
            <el-switch v-model="states.disabled" />
          </el-form-item>
          <el-form-item label="最多字数">
            <el-input-number v-model="states.maxlength" />
          </el-form-item>
          <el-form-item label="最少字数">
            <el-input-number v-model="states.minlength" />
          </el-form-item>
        </el-collapse-item>
      </el-form>
    </el-collapse>
  </div>
</template>

<script setup>
import { computed, onMounted, ref } from "vue";
const loading = ref(true);
const activeNames = ref();
const props = defineProps({
  models: {
    type: Object,
    default: () => ({}),
  },
});
const emit = defineEmits(["update:models"]);

onMounted(() => {
  setTimeout(() => {
    loading.value = false;
  }, 200);
});

const states = computed({
  get: () => props.models,
  set: () => emit("update:models"),
});
</script>

<style scoped lang="scss">
:deep(.el-collapse-item__header) {
  padding-left: 10px !important;
}

:deep(.el-input) {
  width: 180px !important;
}
:deep(.el-select) {
  width: 180px !important;
}
</style>
